﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import flash.utils.*;

    public class ItemClassDefinitions {

        private static const typeHashMap:Object = {
            business:Business,
            decoration:Decoration,
            npc:NPC,
            pier:Pier,
            plot:Plot,
            ship:Ship,
            harvest_ship:HarvestableShip,
            residence:Residence,
            road:Road,
            sidewalk:Sidewalk,
            parking_lot:ParkingLot,
            bridge:Bridge,
            bridgepart:BridgePart,
            storage:Storage,
            train_station:TrainStation,
            wilderness:Wilderness,
            municipal:Municipal,
            landmark:Landmark,
            itemStorage:ItemStorage,
            factory:Factory,
            dockHouse:DockHouse,
            dock:Dock,
            zooEnclosure:ZooEnclosure,
            mall:Mall,
            MunicipalGiftBox:MunicipalGiftBox,
            peddler:Peddler
        };
        private static const defaultClass:Class = Decoration;

        public static function getClassByType(_arg1:String, _arg2:String=""):Class{
            var _local3:Class;
            if (_arg2){
                _local3 = (getDefinitionByName(("Classes." + _arg2)) as Class);
            } else {
                _local3 = typeHashMap[_arg1];
            };
            if (!_local3){
                _local3 = defaultClass;
            };
            return (_local3);
        }
        public static function getClassByItemName(_arg1:String):Class{
            var _local2:Item = Global.gameSettings.getItemByName(_arg1);
            var _local3:Class = getClassByItem(_local2);
            return (_local3);
        }
        public static function getClassByItem(_arg1:Item):Class{
            var _local2:Class = getClassByType(_arg1.type, _arg1.className);
            return (_local2);
        }
        public static function getTypeByClass(_arg1:Class):String{
            var _local3:String;
            var _local4:Class;
            var _local2:String;
            for (_local3 in typeHashMap) {
                _local4 = typeHashMap[_local3];
                if (_local4 == _arg1){
                    _local2 = _local3;
                    break;
                };
            };
            return (_local2);
        }

    }
}//package Classes 
